package composite;

import java.util.ArrayList;
import java.util.List;

/**
 * @author shenhan
 * @create 2020/4/3 10:57
 * @description
 */
public class University extends OrgComponent {

    public University(String name, String des) {
        super(name, des);
    }

    List<OrgComponent> orgComponents = new ArrayList<>();

    @Override
    protected void add(OrgComponent orgComponent) {
        orgComponents.add(orgComponent);
    }

    @Override
    protected void remove(OrgComponent orgComponent) {
        orgComponents.remove(orgComponent);
    }

    @Override
    public String getName() {
        return super.getName();
    }

    @Override
    public String getDes() {
        return super.getDes();
    }

    @Override
    protected void print() {
        System.out.println("==========" + getName() + "==========");
        orgComponents.forEach(OrgComponent::print);
    }
}
